public class SolBase {

    public int rand10() {
        int sum = 0;
        while (sum > 10 || sum == 0) {
            sum = process();
            for (int i = 0; i <= 3; i++) {
                sum <<= 1;
                sum ^= process();
            }
        }
        return sum;
    }

    public int process() {
        int temp = rand7();
        if (temp == 7) return process();
        return temp <= 3 ? 1 : 0;
    }

    private int rand7() {
        return 0;
    }
}
